<!--
 * @Description: 打开app
-->
<template>
	<div class="open_app">
		<wx-open-launch-app id="launch-btn" :extinfo="extinfo" appid="wxdb8b21091717ff69">
			<script type="text/wxtag-template">
				<div style="width:100%;height:1000px;">
        </div>
      </script>
		</wx-open-launch-app>
	</div>
</template>

<script>
	import wx from 'weixin-js-sdk';
	const app = getApp();
	import Vue from 'vue'
	import {
		getConfigParam1
	} from '@/api/home.js';
	export default {
		components: {

		},
		data() {
			return {
				extinfo: {
					'llname': 'ppp',
					'llid': '123456789'
				},
				wxAppId: 'wxdb8b21091717ff69'
			}
		},
		mounted: function() {
			let that = this;
			that.initWxSDK();
		},
		methods: {
			initWxSDK() {
				let that = this;
				getConfigParam1().then(res => {
					wx.config({
						debug: false,
						appId: 'wx92b0e22e2be1ea76',
						timestamp: res.timestamp,
						nonceStr: res.nonceStr,
						signature: res.signature,
						jsApiList: ['onNeedPrivacyAuthorization'],
						openTagList: ['wx-open-launch-app'] // 关键！
					});
					wx.ready((res) => {
						//console.log('成功--------' + JSON.stringify(res));
					});

					wx.error(res => {
						//console.log('失败---------' + JSON.stringify(res));
					});
				})

			},
		}
	}
</script>

<style scoped lang="scss">
	.open_app {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 100%;
		overflow: hidden;

		#launch-btn {
			display: block;
		}
	}
</style>